package IO.g3;

import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Arrays;

public class FileTest implements FilenameFilter{

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		
		String sep = File.separator;
		char separator = File.separatorChar;
		
		File absoluteDirectory = new File(sep+"Uni"+sep);
		System.out.println(absoluteDirectory);
		
		File relativeFile = new File("./src");
		//relativeFile.createNewFile();
		System.out.println(relativeFile.getCanonicalPath());
		
		System.out.println(File.createTempFile("bla", ".txt").getAbsoluteFile());
		
		boolean status;
		status = new File("temp").mkdir();
		status = new File("a/b/").mkdirs();
		
		File[] entries = new File(".").listFiles(new FileTest());
		System.out.println(Arrays.toString(entries));
		
		

	}

	@Override
	public boolean accept(File dir, String name) {
		return new File(dir,name).isFile() && 
				name.toLowerCase().endsWith(".txt");
	}
	
	
	
	
	
	
	

}
